Repository navigation
Restore peer runtime canary validation - #9092
loopx-agent wants to merge 1 commit into
Conversation
Keep legacy hierarchy checks scoped to retired Agent declarations. Bind migration and host onboarding checks to their fixture runtime routes. Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, max)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
运行 peer runtime premerge canary 的维护者,需要能区分业务 controller 和已退役的 Agent 层级。基线在发布说明的正常所有权描述上提前退出。修改后,扫描器接受这类描述,并继续拦截显式旧身份标记。同一聚合入口可以走完十项检查,迁移和接入 fixture 读取各自的 registry 与 runtime。评审覆盖源码校验和真实 fixture 路由。
改动思路 / Approach
删除整句豁免和误判的短语规则,保留明确的旧层级词、JSON role 及旧 host 名。fixture 继续调用原有 builder,并传入自己的路径。三个既有 smoke 继续覆盖 peer 身份、旧配置迁移和接入。改动只触及 fixture 和扫描断言。使用真实 builder 读回的命令和路径校验 fixture 隔离。
具体改动 / Changes
精确 head d043fd2a7128a5824e1209f2820d33f920bf78f7,diff base b927e20bfbe60817570bceb8654e2bfbc96abadf,3 个文件 +28/-12。逐项复核 precise-hierarchy、fixture-registry、fixture-onboarding。验收约定
关键代码讲解
- 扫描器移除宽泛的
controller owns规则和两条整句例外。两类合法描述在基线被拦截,在当前提交通过,五种旧角色及层级标记在两版均被拦截。源码 - 迁移 smoke 传入当前 fixture 的 registry,并核对实际生成的 activation 命令使用同一路径。源码
- 首次接入使用临时 runtime,已连接场景的 builder 与 CLI 子进程共享 fixture 路由。源码
对主干的风险 / Risks
删除宽泛匹配后仍需拦截显式旧标记。独立样例覆盖两类合法描述及五种旧标记,迁移与接入的三条路径也核对了实际输入和路径。
语义与 CI 对齐
同一源码聚合命令在基线因发布说明误报失败,当前提交及与 #9091 的本地试合并均走完十项。改动文件 Ruff 通过。全库 Ruff 与 mypy 仍有同基线的诊断。验证限于本地源码和临时运行时。
我的整体评价 / Verdict
同意当前提交。既有聚合检查恢复可用,旧层级回归用例仍有独立反例,fixture 路由证据也齐全。
English verdict: APPROVE. The exact head restores the registered peer runtime canary, preserves explicit legacy rejection and uses the intended smoke fixture routes.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google (self_reported)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
在工作区执行 peer runtime premerge canary 或宿主多默认注册表并存环境下运行迁移与接入烟雾测试的维护者和自动化检查会遇到这一问题。
修改前,发布说明中描述 benchmark controller 持有 worker lock 的正常语句被宽泛正则误判为已退役的 Agent 层级并提前阻断十项聚合检查,且迁移与接入脚本还会隐式读取宿主机默认运行根目录导致因本地环境冲突失败;修改后,硬切扫描只拦截显式旧层级声明,迁移和接入脚本全部改用各自临时 fixture 路由并走完十项聚合测试。
peer runtime 硬切边界扫描与十项聚合烟雾在包含发布说明的完整代码树以及双默认全局表冲突环境下均可稳定通过,同时保持对五种显式旧层级标记的拦截能力。 本次仅修复既有烟雾测试与边界扫描规则的误报及环境泄漏,不新增额外测试脚本,也不修改任何产品运行时代码或发布文档正文。 在基线提交上,docs/product/releases/v2.4.0.md 第 207 行触发硬切脚本断言失败导致整套 peer-agent-runtime-v1-smoke.py 中断,且宿主机默认目录冲突时迁移与接入烟雾也会失真报错,因此需要恢复该持久验证链路的真实信号。
改动思路 / Approach
修复沿两条独立线索同步收口:第一,将边界扫描从容易伤及“benchmark/session controller 持有锁或控制权”的宽泛 controller owns 匹配,收敛为精确识别退役 Agent 层级与角色字段的规则,从而顺带清除此前为两份文档打上的特例补丁;第二,切断两条夹具路径对当前进程默认工作区或宿主机 ~/.loopx / ~/.codex/loopx 的隐式回落,让构建器与子进程全程复用临时目录内创建的注册表和隔离环境。
| 验证面 | 基线提交 (b927e20bfbe6) |
当前 Head (d043fd2a7128) |
|---|---|---|
| 硬切边界扫描 | 在 v2.4.0.md 第 207 行误报 controller owns 失败 |
通过,接受正常资源所有权描述并继续拒绝五种旧层级词 |
迁移烟雾 (peer-agent-migration-smoke.py) |
双默认全局表冲突时未传 registry_path 导致 ValueError |
显式传入 fresh_registry 并断言输出命令体包含该路径 |
接入烟雾 (agent-onboard-host-loop-activation-smoke.py) |
在本地默认全局表冲突环境下读取宿主默认运行根报错 | 显式关闭工作树别名并隔离 LOOPX_RUNTIME_ROOT 与 loopx.paths |
直接移除导致误报的宽泛子串规则与两处脆性单行豁免,并将两个测试夹具显式绑定到各自临时目录路径,无需引入额外适配层或豁免清单。 当前 PR 严格限定在三个既有 control-plane 烟雾文件内,不改变生产路径或规范文档。 在既有已登记的耐久烟雾内修补断言精度与环境隔离,比继续往 hierarchy_scan_line() 追加逐行豁免更能防止同类误报在后续发布说明中反复出现。
具体改动 / Changes
本次精确评审 head 为 d043fd2a7128a5824e1209f2820d33f920bf78f7,diff base 为 b927e20bfbe60817570bceb8654e2bfbc96abadf,共修改 3 个既有烟雾文件(+28 / -12 行),不新增测试文件也不涉及产品源码变更。规范依据对照 docs/reference/protocols/peer-agent-runtime-v1.md(参考基准修订 b927e20bfbe60817570bceb8654e2bfbc96abadf),对应检查项如下:canonical-identity-guard(已实现,硬切脚本继续拒绝所有非迁移边界内的旧身份词并保留合法资源所有权描述)、migration-fixture-isolation(已实现,迁移烟雾使用自身 fresh_registry)、onboarding-fixture-isolation(已实现,接入烟雾隔离运行目录与别名解析)、cutover-canary-suite(已实现,十项聚合烟雾全通过)。
关键代码讲解
LEGACY_PATTERN与hierarchy_scan_line:移除controller owns宽泛正则及hierarchy_scan_line()中针对controller-executor-unified-contract-v0.md与benchmark_toolkit/README.md的两条特判;同时保留main controller、controller/sub-agent、controller-subagent与 JSONrole正则,并在main()补充反例与正例自检,验证合法控制权表述放行而五种旧层级写法被拦截。peer-agent-migration-smoke.py心跳校验:向build_heartbeat_prompt显式传入registry_path=fresh_registry,并新增断言str(fresh_registry) in heartbeat["task_body"],确保生成的心跳命令与临时夹具绑定而不回落宿主机默认目录。agent-onboard-host-loop-activation-smoke.py夹具隔离:在build_loopx_bootstrap_command_pack调用传入resolve_linked_worktree_alias=False与runtime_root_arg;对连接态夹具段通过patch.dict(os.environ, {"LOOPX_RUNTIME_ROOT": ...})与patch.multiple("loopx.paths", ...)隔离本进程与子进程路径解析。
对主干的风险 / Risks
去掉 controller owns 之后,需确认是否会有真实残留的旧版主从层级文档漏网。对照全仓语义与脚本自检,显式层级标识符(primary_agent、side_agent、handoff_agent、main controller、controller/sub-agent、controller-subagent 以及 "role": "controller"|"subagent")全部保留在正则中;全库 controller owns 现有命中均为单点运行/锁/对话/benchmark 所有权表述,不存在漏放旧架构的风险。另一处关注点是接入烟雾的 patch.dict 包裹了末尾 doctor --agent-type other-agent 用例(741-762 行),经核查 loopx/doctor.py 在 host_managed 模式下不依赖 LOOPX_RUNTIME_ROOT 读取技能状态,且该项断言正常通过。本次未新增任何重复烟雾,修改的三个脚本均为 peer-agent-runtime-v1-smoke.py 与 canary catalog 既有注册项。
本地实测与基线反事实对比如下:
- 基线对比:在
b927e20bfbe6上直接运行旧版peer-agent-hard-cut-boundary-smoke.py在docs/product/releases/v2.4.0.md:207失败;在模拟双默认全局表冲突的隔离HOME下运行旧版peer-agent-migration-smoke.py与agent-onboard-host-loop-activation-smoke.py均抛出ValueError: Both default LoopX registries exist失败。 - 当前 head 实测:三个单脚本(含正常环境与双默认全局表冲突
HOME反事实环境)全部 PASS;聚合套件examples/control_plane/peer-agent-runtime-v1-smoke.py十项全通过;loopx canary premerge --from-git-diff --git-diff-base b927e20bfbe60817570bceb8654e2bfbc96abadf全部 5 项直接检查、7 项 catalog canary 与 1 项公开边界扫描通过。 - 静态检查:
ruff check对 3 个改动文件全部 PASS;mypy --strict --follow-imports=silent在peer-agent-hard-cut-boundary-smoke.py0 错误,在其余两个脚本报 13 处错误,经与基线b927e20bfbe6同一命令比对完全一致(0 条新增错误)。
我的整体评价 / Verdict
同意当前提交。PR 以极小且内聚的修订恢复了 peer-agent-runtime-v1-smoke.py 全套十项验证的可用性,清除了脆性整句特判,并彻底隔离了迁移与接入烟雾对宿主机默认运行根目录的偶然依赖。long_horizon 与 user_experience 均保持原有契约不变;本次不涉及前端渲染界面(visual_review 为 not_applicable;未验证范围为其它独立前端界面)。三个脚本均为已登记的持久 canary 资产,无重复或刷量风险。远端 CI 仍未作为依据(wait_for_ci: false),精确 head d043fd2a7128a5824e1209f2820d33f920bf78f7 的本地回归与边界证据充分。
English verdict: APPROVE. At exact head d043fd2, narrowing the boundary pattern to explicit legacy hierarchy declarations and isolating fixture runtime routes restores the peer-runtime canary suite without weakening legacy enforcement.
Problem
The peer hard-cut check classified ordinary controller ownership as retired Agent hierarchy. The release guide for benchmark CLI activation hit that rule and stopped the peer-runtime aggregate before its migration and onboarding checks. Those two checks also resolved part of their input through the host's default runtime roots, which made the fixture depend on the local installation.
Changes
Validation
b927e20bfbe6the tree-wide scan reports the release guide. Ond043fd2a7128it passes with the guide intact. A separate scan fixture accepts both ownership statements and rejects five retired declarations.4a636c57005c, where the release-guide diagnostic previously stopped standard premerge. Managed worktree PRIndependent review and hosted checks remain pending.